Collection Manager

Introduction

The Collection Manager implements an abstract data type that allows you to store multiple pieces of related information. This abstract data type is called a collection object. A collection object, or simply a collection, is an abstract data type that allows you to store information.

A collection is like an array in that it contains a number of individually accessible items. However, a collection offers some advantages over an array:

• A collection allows for a variable number of data items. You can add items to a collection or remove items from a collection during run time, and the Collection Manager automatically resizes the collection.

• A collection allows for variable-size items. Each item in a collection can contain data of any size.

A collection is also similar to a database, in that you can store information and retrieve it using a variety of search mechanisms.

The internal structure of a collection object is private–you must store information in a collection and retrieve information from it by providing a Collection Manager function with a reference to the collection. You use the functions provided by the Collection Manager to

• create and manipulate collection objects

• add information to a collection object

• retrieve information from a collection object

• store a collection object to disk and retrieve a collection object from disk